#!/bin/sh
set -xv
program=python;

app=spider;
PROJECT_PATH=`pwd`
declare -a arr=$(ps aux|grep $app|grep $program|awk '{print $2}');
for pid in ${arr[@]}; do
  echo "kill $pid";
  kill $pid;
  sleep 0.5
done;
echo "start crawler-spider ..."

exec python $PROJECT_PATH/spider.py >/dev/null 2>&1 &